<style>
  #warehouseHouse-update {
    padding: 20px 25px 25px 0;
  }

  #warehouseHouse-update .layui-treeSelect .ztree li a, .ztree li span {
    margin: 0 0 2px 3px !important;
  }
</style>
<div class="layui-fluid" id="warehouseHouse-update">
  <form class="layui-form" action="" lay-filter="warehouseHouse-update-form">
    <input type="hidden" name="houseid">
    <div class="layui-form-item">
      <label class="layui-form-label febs-form-item-require">仓库名称：</label>
      <div class="layui-input-block">
        <input type="text" name="housename" minlength="1" maxlength="10" lay-verify="required"
               autocomplete="off" class="layui-input">
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label febs-form-item-require">仓库容量：</label>
      <div class="layui-input-block">
        <input type="text" name="housenumber" autocomplete="off" class="layui-input"
               lay-verify="required">
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label febs-form-item-require">储书数量：</label>
      <div class="layui-input-block">
        <input type="text" name="housebooks" autocomplete="off" class="layui-input"
               lay-verify="required|number" readonly>
      </div>
    </div>
    <div class="layui-form-item febs-hide">
      <button class="layui-btn" lay-submit="" lay-filter="warehouseHouse-update-form-submit" id="submit"></button>
    </div>
  </form>
</div>
<script data-th-inline="javascript">
  layui.use(['febs', 'form', 'validate'], function () {
    var $ = layui.$,
        febs = layui.febs,
        layer = layui.layer,
        form = layui.form,
        warehouseHouse = [[${warehouseHouse}]],
        $view = $('#warehouseHouse-update'),
        validate = layui.validate;

    form.verify(validate);
    form.render();
    initwarehouseHouseValue();

    function initwarehouseHouseValue() {
      form.val("warehouseHouse-update-form", {
        "houseid": warehouseHouse.houseid,
        "housename": warehouseHouse.housename,
        "housenumber": warehouseHouse.housenumber,
        "housebooks": warehouseHouse.housebooks,
      });
    }

    form.on('submit(warehouseHouse-update-form-submit)', function (data) {
      if (febs.nativeEqual(data.field, warehouseHouse)) {
        febs.alert.warn('数据未作任何修改！');
        return false;
      }
      febs.post(ctx + 'warehouseHouse/update/', data.field, function () {
        layer.closeAll();
        febs.alert.success(warehouseHouse.housename + ' 数据修改成功');
        $('#febs-warehouseHouse').find('#query').click();
      });
      return false;
    });
  });
</script>